Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some warnings #1112

Merged
merged 3 commits into from
May 31, 2023
Merged

Fix some warnings #1112

merged 3 commits into from
May 31, 2023

Conversation

lars18th
Copy link
Contributor

No description provided.

Fixes:

stream.c:611:5: warning: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Wconstant-conversion]
    copy16(rtp_buf, len + 0, (uint16_t)0x8021);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/minisatip.h:34:27: note: expanded from macro 'copy16'
        a[i] = ((v) >> 8) & 0xFF;                                              \
             ~ ~~~~~~~~~~~^~~~~~
1 warning generated.
@Jalle19
Copy link
Collaborator

Jalle19 commented May 31, 2023

Can you add the warning message to the PR description?

@lars18th
Copy link
Contributor Author

lars18th commented May 31, 2023

Can you add the warning message to the PR description?

It fixes:

stream.c:611:5: warning: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Wconstant-conversion]
copy16(rtp_buf, len + 0, 0x8021);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/minisatip.h:34:27: note: expanded from macro 'copy16'
a[i] = ((v) >> 8) & 0xFF;
~ ~~~~~~~~~~~^~~~~~
1 warning generated.

@lars18th
Copy link
Contributor Author

Hi @Jalle19 ,

Added also a fix for this warning in pmt.c:

pmt.c:1092:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        if ((ad->pids[i].flags == 1)) {
             ~~~~~~~~~~~~~~~~~~^~~~
pmt.c:1092:32: note: remove extraneous parentheses around the comparison to silence this warning
        if ((ad->pids[i].flags == 1)) {
            ~                  ^   ~
pmt.c:1092:32: note: use '=' to turn this equality comparison into an assignment
        if ((ad->pids[i].flags == 1)) {
                               ^~
                               =

Both are detected cross compiling with zig cc that uses LLVM.
Ready to merge?

@lars18th lars18th changed the title Fix warning in stream.c Fix some warnings May 31, 2023
@catalinii catalinii merged commit e277737 into catalinii:master May 31, 2023
@lars18th lars18th deleted the fix-warning branch May 31, 2023 13:50
catalinii pushed a commit that referenced this pull request Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants